/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package modbus;

import java.io.InputStream;
import java.io.OutputStream;

/**
 *
 * @author Leandro
 */
public abstract class Driver {

    protected  InputStream inputStream;
    protected OutputStream outputStream;
    protected boolean connected = false;
    protected int id;
    protected int nroReintentos;
    protected int timeout;
    protected ExpertoComunicacion expertoComunicaciones;

    public int getNroReintentos() {
        return nroReintentos;
    }

    public void setNroReintentos(int nroReintentos) {
        this.nroReintentos = nroReintentos;
    }

    public abstract boolean disconnect();


    public boolean isConnected() {
        return connected;
    }

    public void setConnected(boolean connected) {
        this.connected = connected;
    }

    public ExpertoComunicacion getExpertoComunicaciones() {
        return expertoComunicaciones;
    }

    public void setExpertoComunicaciones(ExpertoComunicacion expertoComunicaciones) {
        this.expertoComunicaciones = expertoComunicaciones;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public InputStream getInputStream() {
        return inputStream;
    }

    public void setInputStream(InputStream inputStream) {
        this.inputStream = inputStream;
    }

    public OutputStream getOutputStream() {
        return outputStream;
    }

    public void setOutputStream(OutputStream outputStream) {
        this.outputStream = outputStream;
    }

    public int getTimeout() {
        return timeout;
    }

    public void setTimeout(int timeout) {
        this.timeout = timeout;
    }

    public abstract boolean send(Paquete p);

    public abstract byte[] receive() ;

    

  

}
